package com.zy.ivideo.repository;

import com.zy.ivideo.entity.BankCardEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Repository
public interface BankCardRepository extends JpaRepository<BankCardEntity,Long> {
//    @Query
    List<BankCardEntity> findBankCardEntitiesByAccountid(Long accountid);

    @Transactional
    @Modifying(clearAutomatically=true)
    @Query()
    int deleteByAccountid(Long accountid);
}
